import CryptoJS from '@ohos/crypto-js'

var key = 'Genshin_Impact12'

export class AESUtil {
  encode(text: string): string {
    var encrypted = CryptoJS.AES.encrypt(text, key).toString() //传参为加密内容及秘钥
    return encrypted
  }

  decode(text: string): string {
    var decrypted = CryptoJS.AES.decrypt(text, key) //传参为加密后的内容及秘钥
    return decrypted
  }
}

export default new AESUtil()